#!/usr/bin/env python
#####################################
# Installation module for Metasploit
#####################################

# AUTHOR OF MODULE NAME
AUTHOR="David Kennedy (ReL1K)"

# DESCRIPTION OF THE MODULE
DESCRIPTION="This module will install/update Metasploit (nightly installs)"

# INSTALL TYPE GIT, SVN, FILE DOWNLOAD
# OPTIONS = GIT, SVN, FILE
INSTALL_TYPE="FILE"

# LOCATION OF THE FILE OR GIT/SVN REPOSITORY
REPOSITORY_LOCATION="https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb"

# WHERE DO YOU WANT TO INSTALL IT
INSTALL_LOCATION="metasploit"

# DEPENDS FOR DEBIAN INSTALLS
DEBIAN="autoconf bison build-essential curl git-core libapr1 libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-dev libreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate ncurses-dev openssl postgresql postgresql-contrib wget xsel zlib1g zlib1g-dev"

# DEPENDS FOR FEDORA INSTALLS
FEDORA=""

# COMMANDS TO RUN AFTER
AFTER_COMMANDS="sudo wget -O - https://apt.metasploit.com/metasploit-framework.gpg.key | apt-key add -,apt-get install --reinstall metasploit-framework,cd {INSTALL_LOCATION},mv msfupdate.erb msfinstall,chmod 755 msfinstall,./msfinstall,rm msfinstall 1> /dev/null 2>/dev/null,update-rc.d postgresql enable,chmod +x {PTF_LOCATION}/modules/exploitation/msfdb.sh,sh {PTF_LOCATION}/modules/exploitation/msfdb.sh 1> /dev/null 2> /dev/null,mkdir /root/.msf4 1> /dev/null 2>/dev/null,cp /opt/database.yml /root/.msf4/,rm -rf {INSTALL_LOCATION} 1> /dev/null 2> /dev/null,mkdir {INSTALL_LOCATION} 1> /dev/null 2> /dev/null,echo 'Metasploit is located under /opt/metasploit-framework/ but you can launch from anywhere by typing msfconsole etc.' > {INSTALL_LOCATION}METASPLOIT_README.txt,rm -rf /usr/local/bin/msf* 1> /dev/null 2> /dev/null"

# THIS WILL CREATE AN AUTOMATIC LAUNCHER FOR THE TOOL
LAUNCHER=""

# BYPASS UPDATES TO RUN INSTALLER EACH TIME
BYPASS_UPDATE="YES"
